import java.util.Scanner;

/**
 * 如果斐波拉切数列的前N项，N由用户输入。
 * 斐波拉切数列的定义是前两个是1，后面的每一个是前面的两个和
 * ，比如N是5,则输出结果是1,1,2,3,5
 */

public class xunhuan3 {
    public static void main(String[] args) {
        System.out.print("请输入一个正整数：");
        Scanner input = new Scanner(System.in);
        String next = input.next();
        int n = Integer.parseInt(next);
        int previous = 0;
        int sum = 1;

        System.out.print("斐波拉切数列为：");
        for (int i = 1; i <= n; i++) {
            System.out.print(sum);
            if (i != n) {
                System.out.print(",");
            }
            int temp = sum;
            sum += previous;
            previous = temp;
        }
    }

}
